package org.dtrd.modules.evaluation.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dtrd.modules.evaluation.entity.bean.EvaluationInfo;

import java.io.Serializable;
import java.util.Date;


/**
 * <p>
 * 量表信息表
 * </p>
 *
 * @author QR
 * @since 2021-11-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dtrd_ent_rd_evaluation")
public class DtrdEntRdEvaluation implements Serializable {


    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 量表名称
     */
    @TableField("evaluation_name")
    private String evaluationName;

    /**
     * 量表简介
     */
    @TableField("intro")
    private String intro;

    /**
     * 答题时间
     */
    @TableField("quiz_time")
    private Integer quizTime;

    @TableField("path")
    private String path;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("create_time")
    private Date createTime;


    public DtrdEntRdEvaluation init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdEvaluation parseFromDTO(EvaluationInfo dto){
        dataId = dto.getDataId();
        evaluationName = dto.getEvaluationName();
        intro = dto.getIntro();
        quizTime = dto.getQuizTime();
        path = dto.getPath();
        return this;
    }
}
